package activity.test;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.logging.LogMDC;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.test.ActivitiRule;
import org.activiti.engine.test.Deployment;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author: 蔡翔
 * @Date: 2019/8/20 19:55
 * @Version 1.0
 */
public class test {
    private static final Logger logger = LoggerFactory.getLogger(test.class);
    @Test
    public void testConfig1(){
        // 注意 如果指定第三方的连接数据库线程池，那就不能用Default的xml了，默认的xml是activiti.cfg.xml
        ProcessEngineConfiguration configuration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti_druid.cfg.xml");
        logger.info("configuration = {}" ,configuration);
        ProcessEngine processEngine = configuration.buildProcessEngine();
        logger.info("获取流引擎 {}",processEngine.getName());
    }
    @Autowired
    ActivitiRule activitiRule;

    @Test
    @Deployment(resources = {"second_approve.bpmn"})
    public void test(){
        LogMDC.setMDCEnabled(true);
        //ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKey()
    }
}
